﻿#region

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

#endregion

namespace CuongHanh.Models
{
    [Table("tbl_ServiceFee")]
    public class ServiceFee : BaseClass
    {
        public ServiceFee()
        {
        }

        public ServiceFee(ServiceFee model)
        {
            Code = model.Code;
            Name = model.Name;
            ShippingCost = model.ShippingCost;
            UtilityFee = model.UtilityFee;
            InVietNam = model.InVietNam;
            Inactive = false;
            LastModified = DateTime.Now;
        }

        [Required]
        public string Code { get; set; }

        [Required]
        public string Name { get; set; }

        [Required]
        public long ShippingCost { get; set; }

        [Required]
        public long UtilityFee { get; set; }

        [Required]
        public bool InVietNam { get; set; }

        public override bool Inactive { get; set; }

        public override DateTime LastModified { get; set; }

        public void UpdateInfo(ServiceFee model)
        {
            Code = model.Code;
            Name = model.Name;
            ShippingCost = model.ShippingCost;
            UtilityFee = model.UtilityFee;
            InVietNam = model.InVietNam;
            LastModified = DateTime.Now;
        }
    }
}
